package com.zzyl.controller;

import com.zzyl.base.PageResponse;
import com.zzyl.base.ResponseResult;
import com.zzyl.dto.DeviceDataPageReqDto;
import com.zzyl.service.DeviceDataService;
import com.zzyl.vo.DeviceDataVo;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Slf4j
@Api(tags = "设备数据管理")
@RequestMapping("/device-data")
public class DeviceDataController {
    @Autowired
    private DeviceDataService deviceDataService;


    /**
     * 获取设备数据分页结果
     * @param pageQueryDto
     * @return
     */
    @GetMapping("/get-page")
    public ResponseResult<PageResponse<DeviceDataVo>> getDeviceDataList(DeviceDataPageReqDto pageQueryDto){
        log.info("获取设备数据分页结果,入参={}",pageQueryDto);
        PageResponse<DeviceDataVo> response = deviceDataService.getDeviceDataList(pageQueryDto);
        return ResponseResult.success(response);
    }


}
